Support latest tplink Archer D9 Firmware version / Device Scanner#15356
Support latest tplink Archer D9 Firmware version / Device Scanner#15356MartinHjelmare merged 4 commits intohome-assistant:devfrom JackNova:tplink-archer-d9-latest-firmware-support
Conversation
MartinHjelmare
left a comment
There was a problem hiding this comment.
See comments here #11827.
Device integration should be done using a pypi package.
|
ok |
|
I just migrated my integration in a pypi package, the idea is to gradually migrate there all the other integrations |
| """ | ||
| from tplink.tplink import TpLinkClient | ||
| _LOGGER.info("Loading wireless clients...") | ||
| client = TpLinkClient( |
There was a problem hiding this comment.
Do we need to create a new client on each update?
There was a problem hiding this comment.
My idea is that on home assistant the client should be just one. Current clients should be gradually migrated on the tplink package. I migrated the one I own and could test
There was a problem hiding this comment.
Yes, but on this line a new client instance is created each time the device tracker scans for new devices. That seems possibly unessecary to me. Would it work to create the client in init method, save the client as an instance attribute, and reuse the same client instance on each update?
There was a problem hiding this comment.
sure, seems a reasonable request.
| def __init__(self, config): | ||
| """Initialize the scanner.""" | ||
| from tplink.tplink import TpLinkClient | ||
| self.host = config[CONF_HOST] |
There was a problem hiding this comment.
Since host isn't used outside this method we can cache it in a local variable, instead of an instance attribute.
| """Initialize the scanner.""" | ||
| from tplink.tplink import TpLinkClient | ||
| self.host = config[CONF_HOST] | ||
| self.password = config[CONF_PASSWORD] |
| from tplink.tplink import TpLinkClient | ||
| self.host = config[CONF_HOST] | ||
| self.password = config[CONF_PASSWORD] | ||
| self.username = config[CONF_USERNAME] |
There was a problem hiding this comment.
great, thanks, I'll refactor
|
Please add a link to a docs PR in the description of this PR. Then we can merge. |
|
@MartinHjelmare I'm not sure I got it. |
|
I meant that you should create a new PR that updates our docs and says what additional model of router is supported. Ie this page: |
|
Ok. Sure. Thanks |
|
done |
Description:
Support latest tplink Archer D9 Firmware version / Device Scanner
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#5808
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: